package com.common.ui;

import android.os.Handler;
import android.os.Looper;
import android.os.Message;


/**
 * Created by Administrator on 2017/2/11.
 */

public class UIHandler extends Handler {
    private IHandler mIHandler;

    public UIHandler(Looper looper){}

    public UIHandler(Looper looper,IHandler handler){
        super(looper);
        this.mIHandler = handler;
    }

    @Override
    public void handleMessage(Message msg) {
        super.handleMessage(msg);
        if(mIHandler != null){
            mIHandler.handlerMessage(msg);
        }
    }

    public void setIHandler(IHandler handler){
        this.mIHandler = handler;
    }

    public interface IHandler{
        public void handlerMessage(Message msg);
    }
}
